using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Outpatient.Doman.Smart
{
    /// <summary>
    /// 咨询详情实体类
    /// </summary>
    [Table("ConsultationDetail")]
    public class ConsultationDetail
    {
        /// <summary>
        /// 详情唯一标识 - 主键，自增
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int DetailId { get; set; }

        /// <summary>
        /// 关联的咨询ID - 外键
        /// </summary>
        [Required]
        public int ConsultId { get; set; }

        /// <summary>
        /// 回复的医生ID - 外键
        /// </summary>
        [Required]
        public int DoctorId { get; set; }

        /// <summary>
        /// 医生回复内容
        /// </summary>
        public string Response { get; set; } = string.Empty;

        /// <summary>
        /// 相关医学知识链接(参考文献)
        /// </summary>
        [StringLength(255)]
        public string MedicalKnowledgeLink { get; set; } = string.Empty;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 是否删除 - 软删除
        /// </summary>
        public bool IsDeleted { get; set; } = false;

        // 导航属性
        [ForeignKey("ConsultId")]
        public virtual Consultation Consultation { get; set; } = null!;
        
        [ForeignKey("DoctorId")]
        public virtual DoctorInfo Doctor { get; set; } = null!;
    }
} 